package starter;

import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JList;
import javax.swing.JTextArea;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JScrollBar;

public class MiriamView extends JFrame {
	
	private JTextField textField;
	private JTextField textField_1;

	//starter
	public static void main(String[] args){
		new MiriamView();
	}

	//constructor
	public MiriamView() {
		FrameSetup();
		
		System.out.println("Het scherm is geladen!");
	}
	
	public void FrameSetup() {
		
		//settings frame
		setTitle("Miriam");
		setVisible(true);
		setResizable(false);
		setSize(500, 300);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLocationRelativeTo(null);

		//hoofdmenu
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		//menu
		JMenu mnNewMenu = new JMenu("");
		menuBar.add(mnNewMenu);

		JMenu mnNewMenu_1 = new JMenu("File");
		menuBar.add(mnNewMenu_1);

		//menu items
		JMenuItem mntmNew = new JMenuItem("New");
		mnNewMenu_1.add(mntmNew);

		JMenuItem mntmOpslaan = new JMenuItem("Opslaan");
		mnNewMenu_1.add(mntmOpslaan);

		JMenuItem mntmSettings = new JMenuItem("Settings");
		mnNewMenu_1.add(mntmSettings);

		JMenu mnEdit = new JMenu("Edit");
		menuBar.add(mnEdit);

		JMenuItem mntmCut = new JMenuItem("Cut");
		mnEdit.add(mntmCut);

		JMenuItem mntmCopy = new JMenuItem("Copy");
		mnEdit.add(mntmCopy);

		//labels
		JLabel lblNewLabel = new JLabel("Welkom");
		JLabel lblNewLabel_1 = new JLabel("");
		JLabel lblDocentDocente = new JLabel("Docent/ Docente");
		JLabel lblTijd = new JLabel("Tijd: ");
		JLabel lblNaam = new JLabel("Naam:");
		JLabel lblDeVraag = new JLabel("De vraag:");

		//fields
		textField = new JTextField();
		textField.setColumns(10);

		textField_1 = new JTextField();
		textField_1.setColumns(10);

		//button afhandelen
		JButton btnNewButton = new JButton("Afhandelen");
		btnNewButton.addActionListener(new ActionListener() {
			//knop met melding
			public void actionPerformed(ActionEvent e) {
				System.out.println("Afgehandeld");
			}
		});

		//jlist (doet volgens mij niet veel?)
		JList list = new JList();
		
		//grouplayout (niet opletten :-))
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
				groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
						.addContainerGap()
						.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblDocentDocente)
								.addGroup(groupLayout.createSequentialGroup()
										.addComponent(lblNaam)
										.addPreferredGap(ComponentPlacement.UNRELATED)
										.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGroup(groupLayout.createSequentialGroup()
												.addComponent(lblTijd)
												.addGap(18)
												.addComponent(textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
												.addPreferredGap(ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
												.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
														.addComponent(lblNewLabel_1)
														.addComponent(lblDeVraag)
														.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
																.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 96, GroupLayout.PREFERRED_SIZE)
																.addComponent(list, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)))
																.addGap(64))
				);
		groupLayout.setVerticalGroup(
				groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
						.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addGroup(groupLayout.createSequentialGroup()
										.addContainerGap()
										.addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
										.addGap(7)
										.addComponent(lblDocentDocente)
										.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
												.addGroup(groupLayout.createSequentialGroup()
														.addGap(22)
														.addComponent(lblDeVraag)
														.addPreferredGap(ComponentPlacement.RELATED)
														.addComponent(list, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE))
														.addGroup(groupLayout.createSequentialGroup()
																.addGap(59)
																.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
																		.addComponent(lblNaam)
																		.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(ComponentPlacement.RELATED)
																		.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
																				.addComponent(lblTijd)
																				.addComponent(textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))))
																				.addGroup(groupLayout.createSequentialGroup()
																						.addGap(39)
																						.addComponent(lblNewLabel_1)))
																						.addGap(31)
																						.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
																						.addGap(16))
				);
		getContentPane().setLayout(groupLayout);
	}

}
